Skip to content

[FE] - NGUYEN NHAT VUONG (Cole - nguyennhatvuongg@gmail.com)#248

Open
Semicof wants to merge 3 commits into
99techteam:mainfrom
Semicof:main
Open

[FE] - NGUYEN NHAT VUONG (Cole - nguyennhatvuongg@gmail.com)#248
Semicof wants to merge 3 commits into
99techteam:mainfrom
Semicof:main

Conversation

@Semicof
Copy link
Copy Markdown

@Semicof Semicof commented Apr 28, 2026

Problem 1: Three ways to sum to N

  • Implemented 3 unique sum_to_n solutions: iterative loop O(n), recursion O(n), and arithmetic formula O(1)
  • Each function includes a comment explaining the approach and time/space complexity
  • Added a test() harness covering 10 cases (including edge cases like 0 and 1) that validates all 3 implementations against expected results

Problem 2: Three ways to sum to N

  • Light mode
image
  • Dark mode
image

Problem 3: Messy React

  • Added missing blockchain property to WalletBalance interface
  • FormattedWalletBalance now extends WalletBalance instead of duplicating fields
  • Removed empty Props interface, use BoxProps directly
  • Moved getPriority outside component and replaced switch with a Record lookup
  • Changed blockchain: any to blockchain: string
  • Removed unused children destructuring
  • Fixed lhsPriority → balancePriority (undefined variable bug)
  • Fixed inverted filter logic: now keeps amount > 0 instead of amount <= 0
  • Sort comparator now returns 0 for equal priorities instead of undefined
  • Removed unused prices from useMemo dependency array
  • Wrapped formattedBalances in useMemo
  • rows now maps over formattedBalances instead of sortedBalances
  • Replaced key={index} with key={balance.currency}
  • Replaced undefined classes.row with a plain className string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant